<?php
namespace Admin\Controller;
use Think\Controller;
/**
* Section
*/
class SectionController extends Controller
{
	public function index()
	{
		$sec = D('Section');
		$list = $sec->relation(true)->find(1);
		print_r($list);

		//创建数据
		$data['title'] = '自定义单元';
		$data['categorys'] = array(
			array('title' => '自定义分类1', 'alias' => 'test1'),
			array('title' => '自定义分类2', 'alias' => 'test2'),
		);
		//$sec->relation(true)->add($data);
		//删除数据
		//$sec->relation(true)->delete("7");
	}
	public function add()
	{
		$this->display();
	}
	public function edit()
	{
		# code...
	}
	public function insert()
	{
		dump($_POST);
	}
	public function update()
	{
		# code...
	}
	public function del()
	{
		# code...
	}
	public function helper()
	{
		echo "提取单元中的所有数据，供用户选择，进行菜单项的创建";
		$sec = D('Section');
		$list = $sec->select();
		dump($list);
		echo '<a href="'.__APP__.'/'.MODULE_NAME.'/Menuitem/add">下一步</a>';
	}
}